<!--<?php
print <<<EOT
-->

<script src="../css/edit.js"></script>
<script>
<!--

function validate(form) {

	if(form.name.value.length < 2 || form.name.value.length > 100) {
		showMsg('msg_area', 'Country must be no more than 100 characters.');
		form.name.focus();
		return false;
	}
	if(form.description.value.length > 250) {
		showMsg('msg_area', 'Description must be no more than 250 characters.');
		form.description.focus();
		return false;
	}
	if (!isDigit(form.seq.value)) {
	    showMsg('msg_area', 'Sequence must be a nunber.');
		form.seq.focus();
		return false;
	}
	
	return true;
}

//-->
</script>

<!--Content Start-->
<table width="95%" border="0" align="center">
  <tr> 
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td>
    
      <form action="p_product_gallery.php" method="post" name="form1" enctype="multipart/form-data" onSubmit="return validate(this)">
      <table width="60%" align="left">
    
      <tr><td>
      <table width="95%" border="0" align="center">
        <tr> 
          <td align="right">&nbsp; </td>
        </tr>
        <tr> 
          <td>
            <table border="0" cellspacing="0" cellpadding="2">
              <tr> 
                <td colspan=2 height=30><span id="msg_area"></span>&nbsp;</td>
              </tr>

              <tr> 
                <td class="tdheader">Name :</td>
                <td><input type="text" class="text" name="name" size="36" value="$name">
                <input type="hidden" name="action" value="add"></td>
              </tr>
              
              <tr> 
                <td class="tdheader">Category :</td>
                <td>
                  <select class="select" name="photo_category_id">
                    
<!--
EOT;
foreach ($photo_category_ary as $k=>$v) {
print <<<EOT
-->

                    <option value="$k" $selected>$v</option>
                    
<!--
EOT;
} print <<<EOT
--> 

                  </select>	  
                </td>
              </tr>
              <tr> 
                <td class="tdheader">Photo :</td>
                <td><input type="file" class="text" name="up_pic" size="45"> </td>
              </tr>
              <tr> 
                <td class="tdheader">Description : </td>
                <td><textarea class="text" name="description" cols="55" rows="20"></textarea></td>
              </tr>
              
              <tr> 
                <td class="tdheader">Sequence :</td>
                <td><input type="text" class="text" name="seq" size="3"></td>
              </tr>             
              
              <tr> 
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
     </td></tr>
    
      <tr><td>
      <table width="95%" border="0" align="left">
        <tr> 
          <td align="center">
            <input type="image" src="../images/admin/bt_cancel.gif" width="78" height="23" onclick="location.href='p_product_gallery.php'; return false;"> 
            <input type="image" src="../images/admin/bt_save.gif" width="76" height="22" onclick="form1.submit"> 
          </td>
        </tr>
      </table>
      </td></tr>
      </table>
      </form>

      <p>&nbsp;</p></td>
  </tr>
</table>
<!--Content End-->

<!--
EOT;
?>-->